<template>
  <div class="content">
    <div class="record-detail">
      <zx-cell-group>
        <zx-cell-item class="boxShadow mb-10">
          <span name="left">{{'CURRENCY'|t}}</span>
          <span name="right" class="c-primary">{{queryData.coinCore}}</span>
        </zx-cell-item>
        <zx-cell-item class="boxShadow mb-10">
          <span name="left">{{'TRANSACTION_TYPE'|t}}</span>
          <span name="right" :class="queryData.type==1?'c-primary':'c-red'">{{queryData.types|t}}</span>
        </zx-cell-item>
        <zx-cell-item class="boxShadow mb-10">
          <span name="left">{{'TRADING_STATE'|t}}</span>
          <span name="right" :class="queryData.state=='1'?c-success:queryData.state=='2'?'c-fail':''">{{queryData.states|t}}</span>
        </zx-cell-item>
        <zx-cell-item class="boxShadow mb-10">
          <span name="left">{{'TRADING_NUMBER'|t}}</span>
          <span name="right">{{queryData.tradeNo}}</span>
        </zx-cell-item>
        <zx-cell-item class="boxShadow mb-10">
          <span name="left">{{'TIME'|t}}</span>
          <span name="right">{{queryData.date}}</span>
        </zx-cell-item>
        <zx-cell-item class="boxShadow mb-10">
          <span name="left">{{'ACTUAL_OUTPUT'|t}}</span>
          <span name="right">{{queryData.actualNum}}</span>
        </zx-cell-item>
        <zx-cell-item class="boxShadow mb-10">
          <span name="left">{{'FORMALITIES'|t}}</span>
          <span name="right">{{queryData.fee}}</span>
        </zx-cell-item>
        <zx-cell-item class="boxShadow mb-10">
          <span name="left">{{'TOTAL_OUTPUT'|t}}</span>
          <span name="right">{{queryData.totalNum}}</span>
        </zx-cell-item>
      </zx-cell-group>
    </div>
  </div>
</template>
<script>
  import { Form, Func, Auth } from '@/providers';
  import { Asset } from '@/services';
  export default {
    data() {
      return {
        queryData: {}
      };
    },
    methods: {
      async getData() {
        try {
          let res = await Asset.GetTradeInfoById({
            token: Auth.getItem('token'),
            userNo: Auth.getItem('userId'),
            id: this.$route.query.id
          });
          this.queryData = res.data.tradeInfo;
          let typeserMap = new Map();
          let stateMap = new Map();
          typeserMap.set(1, 'RECHARGE').set(2, 'WITHDRAWLS').set(3, 'C2C').set(4, 'BB').set(5, 'BB_TRADE');
          stateMap.set(0, 'TRANSFER').set(1, 'SUCCESS').set(2, 'AUDIT').set(3, 'FAILT');
          this.queryData.types = typeserMap.get(this.queryData.category);
          this.queryData.states = stateMap.get(this.queryData.state);
        } catch (error) {
          console.log(error);
        }
      }
    },
    created() {
      this.getData();
    }
  };
</script>
<style scoped lang="scss">
  @import "../../assets/sass/asset.scss";
  .record-detail {
    padding: 1rem;
  }
</style>